from django.contrib import admin

from .models import Category, Task, TaskConf, TaskInputParams, TaskLog, TaskHostLog

# Register your models here.


class CategoryAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'display', 'create_user')


class TaskAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'type', 'category', 'path')


class TaskConfAdmin(admin.ModelAdmin):
    list_display = ('id', 'task_id', 'timeout', 'default_user', 'user_action', 'user_list')


class TaskInputParamsAdmin(admin.ModelAdmin):
    list_display = ('id', 'task_id', 'type', 'default', 'desc', 'required')


class TaskLogAdmin(admin.ModelAdmin):
    list_display = ('id', 'task_id', 'hosts', 'params', 'celery_task_id', 'status', 'output')


class TaskHostLogAdmin(admin.ModelAdmin):
    list_display = ('id', 'task_log_id', 'result_queue_id', 'run_worker_id', 'host', 'status', 'output')


admin.site.register(Category, CategoryAdmin)
admin.site.register(Task, TaskAdmin)
admin.site.register(TaskConf, TaskConfAdmin)
admin.site.register(TaskInputParams, TaskInputParamsAdmin)
admin.site.register(TaskLog, TaskLogAdmin)
admin.site.register(TaskHostLog, TaskHostLogAdmin)